package edu.ptu.springboot04.controller;

import edu.ptu.springboot04.common.controller.AjaxResponse;
import edu.ptu.springboot04.common.controller.BaseController;
import edu.ptu.springboot04.domain.query.LoginQuery;
import edu.ptu.springboot04.service.IUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @BelongsProject: springboot04
 * @BelongsPackage: edu.ptu.springboot04.controller
 * @Author: HYJ
 * @CreateTime: 2025-03-22  00:04
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    // 注入userService
    @Resource
    private IUserService userService;

    // 登录接口
    @PostMapping("/login")
    public AjaxResponse login(@RequestBody LoginQuery loginQuery) {

        return userService.login(loginQuery);
    }

}
